AnimationWindow Class Reference

#include <AnimationWindow.h>

List of all members.

Public Member Functions

 AnimationWindow ()
void processInput (double delta, osg::ref_ptr< PhysicsEventHandler > ph)
void setCamera ()
void setViewer ()
void setScene ()
osg::ref_ptr< osg::Group > getRoot ()
osg::ref_ptr< osgProducer::Viewer > getViewer ()
void createCarPhysics (Vehicle &vehicle, osg::ref_ptr< osg::PositionAttitudeTransform > transform)
void realize ()
void addOtherPhysicalObject (TraffEduObject *object)
void createConstantObjects (OSGWindows *osgWindows)
void odeDraw ()
void exit (OSGWindows *)
vector< CarPhysics * > getpCarPhys ()
vector< OtherPhysicalObjects * > getOtherPhysicalObjects ()
void followVehicle (OSGWindows *osgwindows)
void setRotationArray (Vehicle *)
void loadSkyBox (OSGWindows *osgwindows)
void draw ()
void generateSeq (OSGWindows *window, TrafficLight *ptr)
void deselectAll (OSGWindows *osgwind)

Public Attributes

double physTime
double deltaTime
double throttle
double brake
double steering
Audio * audio_

Private Member Functions

void createControlPoints (Vehicle *vehicle)
void createRotationArray (Vehicle *vehicle)

Private Attributes

vector< CarPhysics * > pCarPhysVector
vector< OtherPhysicalObjects * > otherPhysicalObjects
osg::Matrixd myCameraMatrix
osg::Matrixd cameraRotation
osg::Matrixd cameraTrans
osg::ref_ptr< osg::Group > root
osg::ref_ptr< osgProducer::Viewer > viewer


Detailed Description

AnimationWindow Class When animation button is clicked, an instance of this class is created animation window initializations and calculations are done through this class

Definition at line 6 of file AnimationWindow.h.


Constructor & Destructor Documentation

AnimationWindow::AnimationWindow (   ) 
 

A constructor. initializes sound parameters and scene root

Definition at line 29 of file AnimationWindow.cpp.

References audio_, brake, deltaTime, Audio::initSound(), physTime, root, steering, and throttle.


Member Function Documentation

void AnimationWindow::addOtherPhysicalObject (  TraffEduObject *  object  ) 
 

a normal member taking one argument

Parameters:
object pointer to TraffEduObject creates physical object for a given object

Definition at line 134 of file AnimationWindow.cpp.

References TraffEduObject::getObjectType(), and VEHICLE.

Referenced by createConstantObjects().

void AnimationWindow::createCarPhysics (  Vehicle &  vehicle,
osg::ref_ptr< osg::PositionAttitudeTransform >  transform
) 
 

a normal member taking two arguments

Parameters:
vehicle reference
transform osg::ref_ptr<osg::PositionAttitudeTransform> creates physical car for vehicle object

Definition at line 108 of file AnimationWindow.cpp.

References CarPhysics::create(), PhysicsServer::getInstance(), pCarPhysVector, and PhysicsServer::registerClient().

void AnimationWindow::createConstantObjects (  OSGWindows *  osgWindows  ) 
 

a normal member taking one argument

Parameters:
osgWindows pointer to OSGWindows creates physical objects for all objects

Definition at line 180 of file AnimationWindow.cpp.

References addOtherPhysicalObject(), generateSeq(), OSGWindows::getObjects(), and LIGHT.

void AnimationWindow::createControlPoints (  Vehicle *  vehicle  )  [private]
 

a normal member taking one argument

Parameters:
vehicle pointer to Vehicle create control points for creating the path of the vehicle in animaton

Definition at line 274 of file AnimationWindow.cpp.

References Path::addNewPoint(), TraffEduObject::getObjectPATvector(), Vehicle::getPath(), and TraffEduObject::objectPATvectorSize().

void AnimationWindow::createRotationArray (  Vehicle *  vehicle  )  [private]
 

a normal member taking one argument

Parameters:
vehicle pointer to Vehicle calculate rotations of the vehicle in animaton

Definition at line 387 of file AnimationWindow.cpp.

References Vehicle::getPath(), and Path::setRotationArray().

void AnimationWindow::deselectAll (  OSGWindows *  osgwind  ) 
 

Definition at line 44 of file AnimationWindow.cpp.

References OSGWindows::addCommandDeselectAll(), and osgwind.

void AnimationWindow::draw (   ) 
 

a normal member the animation window's main drawing loop is implemented in this function also the PhysicsServer is stepped.

Definition at line 443 of file AnimationWindow.cpp.

References brake, getpCarPhys(), getViewer(), steering, and throttle.

void AnimationWindow::exit (  OSGWindows *   ) 
 

Definition at line 250 of file AnimationWindow.cpp.

References audio_, Vehicle::deletePath(), OSGWindows::getObjects(), Audio::killALData(), Vehicle::reload(), TraffEduObject::resetCameraFollow(), root, TraffEduObject::setInAnimation(), TraffEduObject::undoPhysicalVehicle(), and VEHICLE.

void AnimationWindow::followVehicle (  OSGWindows *  osgwindows  ) 
 

a normal member taking one argument

Parameters:
osgwindows pointer to OSGWindows set camera follow a vehicle path

Definition at line 356 of file AnimationWindow.cpp.

References OSGWindows::getObjects().

void AnimationWindow::generateSeq (  OSGWindows *  window,
TrafficLight *  ptr
) 
 

the traffic lights timing's is implemented in this function.

Parameters:
window is needed to reach to frames vector
ptr is the pointer to the traffic light object that the timing will be set up for.

Definition at line 148 of file AnimationWindow.cpp.

References TrafficLight::getFrameColor(), OSGWindows::getFrames(), TrafficLight::seqNode, and TrafficModel::trafficLight().

Referenced by createConstantObjects().

vector< OtherPhysicalObjects * > AnimationWindow::getOtherPhysicalObjects (   ) 
 

Definition at line 241 of file AnimationWindow.cpp.

References otherPhysicalObjects.

vector< CarPhysics * > AnimationWindow::getpCarPhys (   ) 
 

Definition at line 237 of file AnimationWindow.cpp.

References pCarPhysVector.

Referenced by draw().

osg::ref_ptr< osg::Group > AnimationWindow::getRoot (   ) 
 

a normal member

Returns:
osg::ref_ptr<osg::Group> returns pointer to the root of the scene

Definition at line 100 of file AnimationWindow.cpp.

References root.

osg::ref_ptr< osgProducer::Viewer > AnimationWindow::getViewer (   ) 
 

a normal member

Returns:
osg::ref_ptr<osgProducer::Viewer> returns pointer to the viewer

Definition at line 97 of file AnimationWindow.cpp.

References viewer.

Referenced by draw().

void AnimationWindow::loadSkyBox (  OSGWindows *  osgwindows  ) 
 

a normal member taking one argument adds skybox node to root

Parameters:
osgwindows 

Definition at line 458 of file AnimationWindow.cpp.

References OSGWindows::getConstantRoot(), osgwind, and root.

void AnimationWindow::odeDraw (   ) 
 

a normal member calls carPhysics odeDraw function for all physical car objects

Definition at line 244 of file AnimationWindow.cpp.

References pCarPhysVector.

void AnimationWindow::processInput (  double  delta,
osg::ref_ptr< PhysicsEventHandler >  ph
) 
 

a normal member taking two arguments and returning void.

Parameters:
delta a double argument.
ph an osg::ref_ptr. sets car acceleration and steering using input handling results

Definition at line 49 of file AnimationWindow.cpp.

References brake, steering, and throttle.

void AnimationWindow::realize (   ) 
 

Definition at line 128 of file AnimationWindow.cpp.

References myCameraMatrix, and viewer.

void AnimationWindow::setCamera (   ) 
 

a normal member sets camera position

Definition at line 81 of file AnimationWindow.cpp.

References cameraRotation, cameraTrans, and myCameraMatrix.

void AnimationWindow::setRotationArray (  Vehicle *   ) 
 

void AnimationWindow::setScene (   ) 
 

a normal member binds the root and the viewer

Definition at line 104 of file AnimationWindow.cpp.

References root, and viewer.

void AnimationWindow::setViewer (   ) 
 

a normal member sets up osgProducer::Viewer

Definition at line 93 of file AnimationWindow.cpp.

References BuildConfig(), and viewer.


Member Data Documentation

Audio* AnimationWindow::audio_
 

Definition at line 30 of file AnimationWindow.h.

Referenced by AnimationWindow(), and exit().

double AnimationWindow::brake
 

Definition at line 18 of file AnimationWindow.h.

Referenced by AnimationWindow(), draw(), and processInput().

osg::Matrixd AnimationWindow::cameraRotation [private]
 

Definition at line 128 of file AnimationWindow.h.

Referenced by setCamera().

osg::Matrixd AnimationWindow::cameraTrans [private]
 

Definition at line 129 of file AnimationWindow.h.

Referenced by setCamera().

double AnimationWindow::deltaTime
 

Definition at line 11 of file AnimationWindow.h.

Referenced by AnimationWindow().

osg::Matrixd AnimationWindow::myCameraMatrix [private]
 

Definition at line 127 of file AnimationWindow.h.

Referenced by realize(), and setCamera().

vector<OtherPhysicalObjects *> AnimationWindow::otherPhysicalObjects [private]
 

Definition at line 126 of file AnimationWindow.h.

Referenced by getOtherPhysicalObjects().

vector<CarPhysics *> AnimationWindow::pCarPhysVector [private]
 

a private variable vector of physical cars

Definition at line 125 of file AnimationWindow.h.

Referenced by createCarPhysics(), getpCarPhys(), and odeDraw().

double AnimationWindow::physTime
 

Definition at line 10 of file AnimationWindow.h.

Referenced by AnimationWindow().

osg::ref_ptr<osg::Group> AnimationWindow::root [private]
 

a private variable scene root

Definition at line 134 of file AnimationWindow.h.

Referenced by AnimationWindow(), exit(), getRoot(), loadSkyBox(), and setScene().

double AnimationWindow::steering
 

a public variable. when a car is set user controlled, steering is set to define car turn angle when user presses a or d key

Definition at line 24 of file AnimationWindow.h.

Referenced by AnimationWindow(), draw(), and processInput().

double AnimationWindow::throttle
 

a public variable. when a car is set user controlled, throttle is set to define car acceleration when user presses w key

Definition at line 17 of file AnimationWindow.h.

Referenced by AnimationWindow(), draw(), and processInput().

osg::ref_ptr<osgProducer::Viewer> AnimationWindow::viewer [private]
 

a private variable viewer

Definition at line 139 of file AnimationWindow.h.

Referenced by getViewer(), realize(), setScene(), and setViewer().


The documentation for this class was generated from the following files:
Generated on Sun May 28 18:54:12 2006 for TraffEdu by  doxygen 1.4.6-NO